/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: hp
 * Date: 2024-07-15
 * Time: 16:20
 */
public class Test4 {
    public static void main(String[] args) throws InterruptedException {
        //NEW
        /*Thread t = new Thread(() -> {

        });
        System.out.println(t.getState());*/

        //TERMINATED
        /*Thread t = new Thread(() -> {

        });
        t.start();
        //Thread.sleep(1000);/t.join();
        System.out.println(t.getState());*/

        //RUNNABLE
        /*Thread t = new Thread(() -> {
            while(true) {

            }
        });

        t.start();
        for (int i = 0; i < 5; i++) {
            System.out.println(t.getState());
            Thread.sleep(1000);
        }*/

        /*Thread t = new Thread(() -> {
            while(true) {
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
            }
        });
        System.out.println(t.getState());
        t.start();
        for (int i = 0; i < 5; i++) {
            System.out.println(t.getState());//TIMED_WAITING
            Thread.sleep(1000);
        }*/


    }


}
